- follow_ups ||= @sales_contact.follow_ups.order('appointment_time desc').limit(10)
.panel.panel-default
  .panel-heading
    .panel-title
      |跟进记录
      = link_to_dialog '新增', new_sales_follow_up_path(firm_id: @sales_contact.firm_id, contact_id: @sales_contact.id), class: 'btn btn-xs btn-info push-10-l', style: 'color:white'
      .pull-right
        = expand_body_button
  .panel-body
    table.table.table-bordered
      tr
        th 安排时间
        th leads类型
        th 负责人
        th 跟进方式
        th 跟进目的
        th 跟进内容
      - follow_ups.each do |f|
        tr
          td
            = link_to_dialog f.appointment_time.try(:label), edit_sales_follow_up_path(f)
            - if f.completed?
              i.fa.fa-check.push-5-l style='color:green' data={toggle: 'popover', 'content': "已完成：#{f.completed_at.label} by #{f.complete_user}"}
          td= f.leads_type_text
          td= f.user
          td= f.follow_up_type_text
          td= f.follow_up_target_type_text
          td== f.content
    - if follow_ups.length==0
      .block 尚无跟进记录！